package com.plian.system.service.sys.bigdata;


import com.plian.Tools.pagedata.PageData;
import com.plian.system.entity.fr.bigdata.Typetime;
import com.plian.system.mapper.fr.time.TypetimeMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * @author huzb
 * @create 2020-10-23 9:02
 */
@Service
@AllArgsConstructor
public class TypetimeService {

    TypetimeMapper typetimeMapper;

    public Integer  insertTimetypeInfo(PageData pd){
        int i = 0;
        String id = TypetimeService.get32UUID();
        pd.put("id",id);
        i = typetimeMapper.inserttypetimeInfo(pd);
        return  i;

    }

    public Typetime selecttypetime(PageData pd){
        Typetime typetime = typetimeMapper.selecttypetime(pd);
        return typetime;
    }

    /**
     * 获取32位UUID
     * @return
     */
    public static String get32UUID() {
        String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
        return uuid;
    }

}
